In computer software, multi-threaded applications have separate paths of execution (threads) that can be run concurrently. Conversely, sequential programs are executed linearly. Multi-threaded applications are able to take advantage of multiprocessor hardware and can improve the perceived responsiveness of an application and improve its actual performance.
When instructions in an application are executed concurrently the execution usually becomes nondeterministic, that is, the order that threads run may be variable. This introduces a complexity to programming that may give rise to defects that are difficult to debug.
Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.